<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入vue.js  -->
    <script src="../node_modules/vue/dist/vue.js"></script>
    <style>
        ul {
            margin: 10px;
        }
        li {
            line-height: 30px;
        }
        p {
            display: inline;
        }
        span {
            border: 1px solid red;
            padding: 2px;
            color: red;
            font-size: 13px;
        }
    </style>
</head>
<body>
    <!-- #app id为app的 ul -->
    <ul id="app">
            <li v-for="item in goodsList">
                <p>{{ item.title }}</p>
                <span v-if="item.hot">火爆</span>
            </li>
    </ul>
    <script>
        // 实例化vuejs应用
        var vm = new Vue({
            el: "#app",
            data: {
                goodsList: [
                    {title: '哈密大枣',hot: true,id:1},
                    {title: '和田大枣',hot: true,id:2},
                    {title: '若羌枣',hot: true,id:2},
                ]
            },
        })
    </script>
</body>
</html>
